<%-- 
    Document   : registerUser
    Created on : Jun 16, 2012, 9:39:52 PM
    Author     : Arnold
--%>

<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Curriculum-based Subject Reservation System</title>
        <sj:head jqueryui="true" jquerytheme="south-street" compressed="false"/>
        <script src="../js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
        <script src="../js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
        <link rel="stylesheet" href="../css/validationEngine.jquery.css" type="text/css"/>
        <link rel="stylesheet" type="text/css" href="../css/globalStyle.css"/>
        <script type="text/javascript" src="../js/globalScript.js"></script>
        <script type="text/javascript" src="../js/reservedSubjects.js"></script>
    </head>
    <body>
        <div id="pageWrapper">
            <!--            <div id="headerComponent">-->
            <jsp:include page="../components/headerComponent.jsp"/>

            <!--            </div>-->

            <div id="contentComponent">
                <div class="gen-green-border">
                    <h2 class="gen-header">
                        New Student Registration 
                    </h2>
                    <p class="gen-padding">
                        This is an online Subject Reservation System of Panpacific University North Philippines.<br>
                    </p>
                    <div class="gen-padding gen-margin">
                        <span class="gen-font-bold">Please select a Subject Offering :</span>
                        <s:url id="subjectofferingurl" action="view~college-subjectoffering"/>
                        <sj:select name="subjectOfferingID"
                                   id="subjectOfferingID"
                                   href="%{subjectofferingurl}"
                                   list="collegeSubjectOfferingList"
                                   listKey="subjectOfferingID"
                                   listValue="collegeSubjectOfferingName" 
                                   onChangeTopics="reloadSubjectOffering"
                                   formIds="registerForm"
                                   cssClass="gen-long-text-width validate[required]"
                                   emptyOption="true"
                                   />
                    </div>
                    <div class="gen-padding gen-margin">
                        <s:url id="remoteurl" action="view~subjectoffering-blocks"/>
                        <s:url id="blockscheduleurl" action="view~subjectoffering-schedules"/>
                        <sjg:grid
                            id="gridSubjectOfferings"
                            caption="Subject Offerings"
                            dataType="json"
                            href="%{remoteurl}"
                            gridModel="blockList"
                            rowNum="-1"
                            multiselect="false"
                            onSelectRowTopics="rowselect"
                            resizableHelper="true" width="1000"
                            cssStyle="margin:5px 0px"
                            pager="true"
                            pagerButtons="false"
                            pagerInput="false"
                            hoverrows="true"
                            autoencode="true"
                            viewrecords="true"
                            navigator="true"
                            navigatorAdd="false"
                            navigatorDelete="false"
                            navigatorEdit="false"
                            navigatorSearch="false"
                            navigatorView="false"
                            >
                            <sjg:grid
                                subGridUrl="%{blockscheduleurl}"
                                id="gridBlockSchedule"
                                gridModel="blockScheduleList"
                                caption="Block Schedules"
                                rowNum="-1"
                                footerrow="false"
                                multiselect="true"
                                userDataOnFooter="false"
                                navigator="true"
                                navigatorAdd="false"
                                navigatorEdit="false"
                                navigatorDelete="false"
                                navigatorSearch="false"
                                pager="true"
                                pagerButtons="false"
                                pagerInput="false"
                                >
                                <sjg:gridColumn name="scheduleID" index="scheduleID" title="Schedule ID" hidden="true" key="true"/>
                                <sjg:gridColumn name="subjectName" index="subjectName" title="Subject" sortable="false" search="false" width="200"/>
                                <sjg:gridColumn name="subjectDescription" index="subjectDescription" title="Description" sortable="true" search="true" width="300"/>    
                                <sjg:gridColumn name="units" index="units" title="Units" sortable="true" search="false" align="center" width="100"/>    
                                <sjg:gridColumn name="scheduleName" index="scheduleName" title="Schedule" sortable="false" search="true" width="300"/>  
                            </sjg:grid>
                            <sjg:gridColumn name="blockID" index="blockID" title="Block ID" hidden="true" key="true"/>
                            <sjg:gridColumn name="programName" index="programName" title="Program" sortable="true" search="false" align="center"/>
                            <sjg:gridColumn name="programRevisionName" index="programRevisionName" title="Revision" sortable="true" search="false" align="center"/>
                            <sjg:gridColumn name="year" index="year" title="Year" sortable="true" search="false" align="center"/>
                            <sjg:gridColumn name="semester" index="semester" title="Semester" sortable="true" search="false" align="center"/>  
                            <sjg:gridColumn name="blockName" index="blockName" title="Block Name" sortable="true" search="true" align="center"/>    
                        </sjg:grid>
                        <sj:submit id="reserveSubject" value="Reserve Subjects" cssClass="gen-tb-margin" button="true" openDialog="confirmationDialog"/>
                        <sj:dialog
                        id="confirmationDialog"
                        autoOpen="false"
                        modal="true"
                        buttons = "{
                        'Yes':function() { reserveSubjects(); },
                        'No':function() { $('#confirmationDialog').dialog('close'); }
                        }"
                        title="Reserve Select Subjects"
                        >
                        Are you sure you want to send the selected item/s for approval?
                    </sj:dialog>
                    </div>

                    <sj:dialog autoOpen="false" closeOnEscape="true" modal="true" id="messageDialog" title="CBSRS"
                               buttons="{
                               'Ok':function() {  $('#messageDialog').dialog('close'); }
                               }">
                    </sj:dialog>
                </div>
            </div>
            <div id="footerComponent">
                <hr />
                Copyright &COPY; 2012 Panpacific University North Philippines<br />
                All rights reserved. <br/>

            </div>
        </div>
    </body>
</html>
